<div class="role-edit-container" [@fadeIn]>
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">编辑权限</h3>
    </div>
    <div class="panel-body">
      <form #form="ngForm" (ngSubmit)="form.form.valid" novalidate class="form-horizontal" role="form">
        <div class="form-group" [ngClass]="{ 'has-error': form.submitted && !permissionName.valid }">
          <label class="col-md-2 control-label">名称：</label>
          <div class="col-md-10">
            <input required name="permissionName" [(ngModel)]="permission.permissionName" #permissionName="ngModel"
              type="text" class="form-control" placeholder="请输入名称">
            <div *ngIf="form.submitted && !permissionName.valid" class="text-danger">权限名称必须输入！</div>
          </div>
        </div>
        <div *ngIf="error" class="col-md-offset-2 col-md-10 alert alert-danger">{{error}}</div>
        <div class="form-group">
          <div class="col-md-offset-2 col-md-10">
            <button type="submit" class="btn btn-primary btn-margin-1rem">保存</button>
            <button type="button" class="btn btn-default" (click)="cancel()">取消</button>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>